<template>
  <view>
    <sunny-video
      ref="sunnyVideo"
      :title="mingzhi"
      :src="vodie[0].sping_url"
      :poster="tup != '' ? tup : ''"
      @timeupdate="timeupdate"
      :trialTime="vipi.vipid == 'true' ? 0 : 30"
    />
    <!-- <uni-section title="基础用法" type="line" padding>
      <view class="example-body">
        <AVideoPalyer
          src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-uni-app-doc/3c1782e0-60ab-11eb-8ff1-d5dcf8779628.m4v"
        ></AVideoPalyer>
      </view>
    </uni-section>-->
  </view>
</template>

<script lang="ts" setup>
// import AVideoPalyer from '@/uni_modules/a-video-player/components/a-video-player/a-video-player.nvue'
import sunnyVideo from '@/uni_modules/sunny-video/components/sunny-video/sunny-video.vue'
import { ref ,getCurrentInstance} from 'vue'

import { getsjuan, getVideoList, getVideo } from '@/services/my copy'
import { guanzhuStore, myStore, ShouyeStore, vip } from '@/stores'
import { formatMessageDate, formatTime, getChatTime } from '@/composables/time'
// #ifdef MP-WEIXIN
import unibadge from '../../components/uni-badge/uni-badge.vue'
import unipopup from '../../components/components/uni-popup/uni-popup.vue'

// #endif
import { onLoad, onShow, onHide, onReady } from '@dcloudio/uni-app'
const mingzhi = ref('')
const { proxy } = getCurrentInstance() as any
const vodie = ref<any>({})
const tup = ref('')
const vipi = vip()
onLoad(async (e: any) => {
  mingzhi.value = e.mingchen
  let res = await getVideo({ mingzhi: mingzhi.value, kechen: e.kechen, nianji: e.nianji })
  console.log(res, '视频数据')
  vodie.value = res.data
  const match =vodie.value[0].sping_url.match(/([^\/]+)\.mp4/);
  vodie.value[0].sping_url = proxy.$baseUrl+'/api/getspingAPI/'+ match[1]
  console.log(vodie.value[0], '视频数据11')
  tup.value = proxy.$baseUrl +'/'+ vodie.value[0].titlepic
  console.log(tup.value, '图片')
})
onReady(() => {
  // #ifdef H5
  // fix by mehaotian 处理 h5 滚动穿透的问题
  document.getElementsByTagName('body')[0].style.overflow = 'hidden'
  // #endif

})
</script>

<style lang="scss" scoped></style>
